<?php

/**
 * Description of IndexController
 *
 * @author FFOZEU
 */
namespace Applications\Modules\Packs\Frontend\Controller;

use Library\BackController;
use Library\HttpRequest;
use Library\Tools;

class PacksController extends BackController{
    
    public function executeIndex(HttpRequest $request){
        // On ajoute une définition pour le titre
        $this->page->addVar('title', 'Les différents packs de credits');
        
        $manager = $this->managers->getManagerOf('Packs');
        
        $packs = $manager->getPacks();
        
        $this->page->addVar('packs', $packs);
        $tools = new Tools();
        foreach ($packs as $value) {
            $value->setCreditsPluriel($tools->pluriel($value->getCredits()));
        }
    }
    
    public function executeCancelPayment(HttpRequest $request){
        $this->page->addVar('title', 'Paiement annulé');
    }
    
    public function executeAccpetPayment(HttpRequest $request){
        $this->page->addVar('title', 'Paiement accepté');
    }
}

?>
